package datos;
import java.sql.Connection;
import java.sql.Driver;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
 *
 * @author Rafael Castelo
 */
public class Conexion {
    private Connection conection = null;
    public Connection getConection() {
       if (conection == null) {
           try {
               Driver driver = new com.mysql.jdbc.Driver();
               DriverManager.registerDriver(driver);
               conection = DriverManager.getConnection("jdbc:mysql://localhost:3306/agenda", "root", "root");
              
           } catch (SQLException ex) {
               Logger.getLogger(Conexion.class.getName()).log(Level.SEVERE, null, ex);
           }
       }
       return conection;
   }
}
